package com.xiaotong.shopping.admin.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.xiaotong.shopping.admin.service.HelloService;
import lombok.extern.log4j.Log4j;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@Log4j2
public class HelloController {

    @Reference(group = "${shopping.group}", timeout = 60000)
    private HelloService helloService;

    @RequestMapping("/hello")
    public String sayHello(){
        return helloService.sayHello();
    }

    @RequestMapping("/show")
    public Map<Object, Object> testSource(){
        Map<Object, Object> show = helloService.show();
        log.info("显示正常了");
        return show;
    }
}
